#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
/*int  my_strlen(char* str)
{
	int count = 0;
	while (*str)
	{
		count++;
		str++;
	}
	return count;
}
int main()
{
	char arr[] = { "abcdefg" };
	int  ret = my_strlen(arr);
	printf("%d ",ret);


	return  0;
}*///模拟实现strlen(方法一)
int  my_strlen(char* str)
{
	char* start = str;
	while (*str)
	{
		
		str++;
	}
	return str-start;
}
int main()
{
	char arr[] = { "abcdefg" };
	int  ret = my_strlen(arr);
	printf("%d ", ret);


	return  0;
}//模拟实现strlen(方法二)